﻿using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Linq;
using VOL.Core.Utilities;
using VOL.Entity.DomainModels;
using VOL.Team.IServices;
using VOL.Team.TeamIservices.TeamManagement.IServices;
using Yitter.IdGenerator;

namespace VOL.WebApi.Controllers.Team.xzc
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class TeamManagementController : ControllerBase
    {
        private readonly ITeamledgersService _teamledgersService;

        public TeamManagementController(ITeamledgersService teamledgersService)
        {
            _teamledgersService = teamledgersService;
        }
        /// <summary>
        /// 查询班组台账
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public WebResponseContent GetTeamledger()
        {
            WebResponseContent webResponseContent = new WebResponseContent();
            var teamledgerList = _teamledgersService.GetTeamledger();
            return webResponseContent.OK("查询班组台账成功", teamledgerList);
        }
        /// <summary>
        /// 获得当前时间的班组--bpy
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public WebResponseContent GetNowTeamledger()
        {
            WebResponseContent webResponseContent = new WebResponseContent();
            var teamledgerList = _teamledgersService.GetNowTeamledger();
            return webResponseContent.OK("查询当前时刻班组台账成功", teamledgerList);
        }

        /// <summary>
        /// 获得b报工信息--bpy
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public WebResponseContent GetSigningWork()
        {
            WebResponseContent webResponseContent = new WebResponseContent();
            var teamledgerList = _teamledgersService.GetSigningWork();
            return webResponseContent.OK("查询报工信息成功", teamledgerList);
        }


        [HttpGet]
        public string GetCode()
        {
            var code = Guid.NewGuid().ToString();
            return code;
        }


    }
}
